/*
 * @Author: 谢子健 1075010289@qq.com
 * @Date: 2024-09-22 21:50:01
 * @LastEditors: 谢子健 1075010289@qq.com
 * @LastEditTime: 2024-10-16 16:16:44
 * @FilePath: \ilink-vue-frontend\src\api\data\datasetDetails.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/*
 * @Author: 谢子健 1075010289@qq.com
 * @Date: 2024-09-21 23:07:55
 * @LastEditors: 谢子健 1075010289@qq.com
 * @LastEditTime: 2024-10-02 17:41:32
 * @FilePath: \ilink-vue-frontend\src\api\data\datasetDetails.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// src/api/data/datasetDetails.ts
import { api } from '../api';

export const getContentDataByIdApi = async (targetId: string) => {
  try {
    // 使用对象作为请求体
    const response = await api.post('/java/ground/dataset/get_dataset_metadata_by_id', { targetId });
    return response.data;
  }
  catch (error) {
    console.error('获取数据集信息失败', error);
    throw error;
  }
};

export const getPublishDataByIdApi = async (targetId: string) => {
  try {
    const response = await api.post('/java/ground/dataset/get_dataset_publish_by_id', { targetId });
    return response.data;
  }
  catch (error) {
    console.error('获取数据集信息失败', error);
    throw error;
  }
};

export const getDatasetInstructionByIdApi = async (targetId: string) => {
  try {
    const response = await api.post('/java/ground/dataset/get_dataset_instruction_by_id', { targetId });
    return response.data;
  }
  catch (error) {
    console.error('获取数据集信息失败', error);
    throw error;
  }
};

export const getDatasetReadmeByIdApi = async (targetId: string) => {
  try {
    const response = await api.post('/java/ground/dataset/get_dataset_Readme_by_id', { targetId });
    return response;
  }
  catch (error) {
    console.error('获取数据集信息失败', error);
    throw error;
  }
};
